import 'package:flutter/material.dart';
import './flip_widget.dart';

class FlipWidgetPage extends StatelessWidget {
  final digits = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('FlipWidgetPage'),
      ),
      body: Center(
        child: FlipWidget.builder(
          itemBuilder: (context, index) => Container(
            alignment: Alignment.center,
            width: 96.0,
            height: 128.0,
            decoration: BoxDecoration(
              color: Colors.black,
              borderRadius: BorderRadius.all(Radius.circular(4.0)),
            ),
            child: Text(
              '${digits[index]}',
              style: TextStyle(
                  fontWeight: FontWeight.bold,
                  fontSize: 80.0,
                  color: Colors.yellow),
            ),
          ),
          itemsCount: digits.length,
          period: Duration(milliseconds: 1000),
          loop: -1,
        ),
      ),
    );
  }
}
